/**
 * 
 */
package jpa_objects;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 * @author Alejandro Casas
 *
 */
@Entity
public class Branch {
	private String name;
	private String address; 
	private String country; 
	private String opening_hours; 
	private String emailBranch; 
	private String phoneBranch;
	private String mailBusiness;
	private City city;
	private double lat;
	private double lng;
	private long id;
	private List<Sport> sports;
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * @param address the address to set
	 */
	public void setAddress(String address) {
		this.address = address;
	}
	/**
	 * @return the country
	 */
	public String getCountry() {
		return country;
	}
	/**
	 * @param country the country to set
	 */
	public void setCountry(String country) {
		this.country = country;
	}
	/**
	 * @return the opening_hours
	 */
	public String getOpening_hours() {
		return opening_hours;
	}
	/**
	 * @param opening_hours the opening_hours to set
	 */
	public void setOpening_hours(String opening_hours) {
		this.opening_hours = opening_hours;
	}
	/**
	 * @return the emailBranch
	 */
	public String getEmailBranch() {
		return emailBranch;
	}
	/**
	 * @param emailBranch the emailBranch to set
	 */
	public void setEmailBranch(String emailBranch) {
		this.emailBranch = emailBranch;
	}
	/**
	 * @return the phoneBranch
	 */
	public String getPhoneBranch() {
		return phoneBranch;
	}
	/**
	 * @param phoneBranch the phoneBranch to set
	 */
	public void setPhoneBranch(String phoneBranch) {
		this.phoneBranch = phoneBranch;
	}
	/**
	 * @return the mailBusiness
	 */
	public String getMailBusiness() {
		return mailBusiness;
	}
	/**
	 * @param mailBusiness the mailBusiness to set
	 */
	public void setMailBusiness(String mailBusiness) {
		this.mailBusiness = mailBusiness;
	}
	/**
	 * @return the city
	 */
	@OneToOne(targetEntity=City.class,cascade=CascadeType.ALL)
	public City getCity() {
		return city;
	}
	/**
	 * @param city the city to set
	 */
	public void setCity(City city) {
		this.city = city;
	}
	/**
	 * @return the lat
	 */
	public double getLat() {
		return lat;
	}
	/**
	 * @param lat the lat to set
	 */
	public void setLat(double lat) {
		this.lat = lat;
	}
	/**
	 * @return the lng
	 */
	public double getLng() {
		return lng;
	}
	/**
	 * @param lng the lng to set
	 */
	public void setLng(double lng) {
		this.lng = lng;
	}
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}
	
	/**
	 * @return the sports
	 */
	@OneToMany(targetEntity=Sport.class,cascade=CascadeType.ALL)
	public List<Sport> getSports() {
		return sports;
	}
	/**
	 * @param sports the sports to set
	 */
	public void setSports(List<Sport> sports) {
		this.sports = sports;
	}
	/**
	 * @param name
	 * @param address
	 * @param country
	 * @param opening_hours
	 * @param emailBranch
	 * @param phoneBranch
	 * @param mailBusiness
	 * @param city
	 * @param lat
	 * @param lng
	 */
	public Branch(String name, String address, String country,
			String opening_hours, String emailBranch, String phoneBranch,
			String mailBusiness, City city, double lat, double lng) {
		this.name = name;
		this.address = address;
		this.country = country;
		this.opening_hours = opening_hours;
		this.emailBranch = emailBranch;
		this.phoneBranch = phoneBranch;
		this.mailBusiness = mailBusiness;
		this.city = city;
		this.lat = lat;
		this.lng = lng;
		this.sports=new ArrayList<Sport>();
	}
	/**
	 * 
	 */
	public Branch() {
		super();
		//
	}
	
	
}
